home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / wais / waisgate / HTSInit.c < prev    next >
C/C++ Source or Header  |  1995-05-09  |  3KB  |  106 lines

  1. /*        Configuration-specific Initialialization    HTInit.c
  2. **        ----------------------------------------
  3. ** This file is for a server.
  4. */
  5.  
  6. /* Implements: */
  7.  
  8. #include "HTInit.h"
  9.  
  10.  
  11. /*    Define a basic set of suffixes and presentations
  12. **    ------------------------------------------------
  13. */
  14.  
  15. /* #include "HTML.h"    */
  16. /* #include "HTPlain.h"    */
  17.  
  18. #include "HTMLGen.h"
  19. #include "HTFile.h"
  20. #include "HTFormat.h"
  21.  
  22. #include "HTMIME.h"
  23. #include "HTWSRC.h"
  24.  
  25. PUBLIC void HTFormatInit NOARGS
  26. {
  27. #ifdef NeXT
  28.   HTSetPresentation("application/postscript", "open %f",    1.0, 0.0, 0.0);
  29.   HTSetPresentation("image/gif",         "open %f",     1.0, 0.0, 0.0);
  30.   HTSetPresentation("audio/basic",         "open %f",     1.0, 0.0, 0.0);
  31.   HTSetPresentation("*",             "open %f",     1.0, 0.0, 0.0);
  32. #else
  33.  if (getenv("DISPLAY")) {    /* Must have X11 */
  34.   HTSetPresentation("application/postscript", "ghostview %f",    1.0, 0.0, 0.0);
  35.   HTSetPresentation("image/gif",         "xv %f",     1.0, 0.0, 0.0);
  36.   HTSetPresentation("image/jpeg",         "xv %f",     1.0, 0.0, 0.0);
  37.  }
  38. #endif
  39.  
  40.  HTSetConversion("www/mime",  "*",           HTMIMEConvert,     1.0, 0.0, 0.0);
  41.  HTSetConversion("application/x-wais-source",
  42.                "*",           HTWSRCConvert,     1.0, 0.0, 0.0);
  43. #ifdef BROWSER_ONLY
  44.  HTSetConversion("text/html", "text/x-c",    HTMLToC,             0.5, 0.0, 0.0);
  45.  HTSetConversion("text/html", "text/plain",  HTMLToPlain,     1.0, 0.0, 0.0);
  46.  HTSetConversion("text/html", "www/present", HTMLPresent,     0.5, 0.0, 0.0);
  47.  HTSetConversion("text/plain", "www/present", HTPlainPresent,    1.0, 0.0, 0.0);
  48. #endif
  49.  HTSetConversion("text/plain", "text/html",  HTPlainToHTML,    1.0, 0.0, 0.0);
  50. }
  51.  
  52.  
  53.  
  54. /*    Define a basic set of suffixes
  55. **    ------------------------------
  56. **
  57. **    The first suffix for a type is that used for tempprary files
  58. **    of that type.
  59. */
  60.  
  61. #ifndef NO_INIT
  62. PUBLIC void HTFileInit NOARGS
  63. {
  64.     
  65.     HTSetSuffix(".mime","www/mime", 1.0);    /* Internal -- MIME is not recursive */
  66.     
  67.     HTSetSuffix(".PS",    "application/postscript", 0.8);
  68.     HTSetSuffix(".eps",    "application/postscript", 0.8);
  69.     HTSetSuffix(".ai",    "application/postscript", 0.5);    /* Adobe illustator */
  70.     HTSetSuffix(".ps",    "application/postscript", 0.8);
  71.     
  72.     HTSetSuffix(".html","text/html", 1.0);    /* Jumping the gun a little */
  73.  
  74.     HTSetSuffix(".c",    "text/plain", 0.5);
  75.     HTSetSuffix(".h",    "text/plain", 0.5);        /* html better */
  76.     HTSetSuffix(".m",    "text/plain", 0.5);        /* Objective-C code */
  77.     HTSetSuffix(".txt", "text/plain", 0.5);
  78.  
  79.     HTSetSuffix(".rtf",    "application/x-rtf", 1.0);
  80.     
  81.     HTSetSuffix(".src",    "application/x-wais-source", 1.0);
  82.     
  83.     HTSetSuffix(".snd", "audio/basic", 1.0);
  84.     
  85.     HTSetSuffix(".bin",    "application/octet-stream", 1.0);    /* @@@@@@@@@@@@@@@@ */
  86.  
  87.     HTSetSuffix(".Z",    "application/x-compressed", 1.0);    /* @@@@@@@@@@@@@@@@ */
  88.     
  89.     HTSetSuffix(".gif", "image/gif", 1.0);
  90.  
  91.     HTSetSuffix(".tiff","image/x-tiff", 1.0);
  92.     
  93.     HTSetSuffix(".jpg", "image/jpeg", 1.0);
  94.     HTSetSuffix(".JPG", "image/jpeg", 1.0);
  95.     HTSetSuffix(".JPEG","image/jpeg", 1.0);
  96.     HTSetSuffix(".jpeg","image/jpeg", 1.0);
  97.     
  98.     HTSetSuffix(".MPEG","video/mpeg", 1.0);
  99.     HTSetSuffix(".mpg","video/mpeg", 1.0);
  100.     HTSetSuffix(".MPG","video/mpeg", 1.0);
  101.     HTSetSuffix(".mpeg","video/mpeg", 1.0);
  102.  
  103. }
  104. #endif /* NO_INIT */
  105.  
  106.